package com.zh.controller;


import com.alibaba.fastjson.JSON;
import com.zh.dto.input.ValidStudentModel;
import com.zh.model.RestResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Slf4j
@RestController
@RequestMapping("/validated")
public class ValidatedController {


    @PostMapping("/student")
    public RestResponse<String> studentValidated(@RequestBody @Validated ValidStudentModel param){
        log.info("ValidController_studentValid:param:{}", JSON.toJSONString(param));
        return RestResponse.ok("ok");
    }


}
